package raft

//
// example RequestVote RPC arguments structure.
// field names must start with capital letters!
//
type RequestVoteArgs struct {
	Term        int
	CandidateID int

	LastLogIndex EntryIndex
	LastLogTerm  int
	// Your data here (2A, 2B).
}

//
// example RequestVote RPC reply structure.
// field names must start with capital letters!
//
type RequestVoteReply struct {
	Term        int // same as the Term in req args
	VoteGranted bool
	// Your data here (2A).
}

type RequestAppendArgs struct {
	Term     int
	LeaderId int

	PrevLogIndex EntryIndex
	PrevLogTerm  int
	Entries      []LogEntry

	LeaderCommit EntryIndex
}

type RequestAppendReply struct {
	Term    int
	Success bool
	XTerm   int
	XIndex  EntryIndex
}

type RequestInstallSnapshotArgs struct {
	Term              int
	LeaderId          int
	LastIncludedIndex EntryIndex
	LastIncludedTerm  int
	Snapshot          []byte
}
type RequestInstallSnapshotReply struct {
	Term int
}
